package com.atguigu.principle.dependInversion.dependDeliver3Way.setMethodDeliver;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description: 依赖传递方式-3：setter方法传递（通过setter方法实现依赖传递）
 * @create: 2022-01-10 16:02
 **/
public class SetMethodDeliver {
    public static void main(String[] args) {
        OpenAndClose openAndClose = new OpenAndClose();

        //抛出异常：该接口引用了ITv接口，但是在OpenAndClose.java中尚未实例化ITv的实现类
        //openAndClose.open();

        openAndClose.setTv(new ChangHongTv());
        openAndClose.open();
    }
}
